<?php

class HomeController extends Controller
{
	
	public function __construct($model, $action)
	{
		parent::__construct($model, $action);
		
		$this->setModel($model);
		$this->setView("index");
	}
	
	public function index()
	{
		try {
			
			//Model
			$item = $this->model->getItem();
			
			//Set della view
			$this->view->set("item", $item);
			
			//ritorno la view
			return $this->view->output();
	
		} catch (Exception $e) {
			echo "Application error:" . $e->getMessage();
		}
	}
}